home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / a_man / cat7 / ip.z / ip
Encoding:
Text File  |  1998-10-20  |  5.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. IIIIPPPP((((7777PPPP))))                                                                  IIIIPPPP((((7777PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ip - Internet Protocol
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ssssoooocccckkkkeeeetttt....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttiiiinnnneeeetttt////iiiinnnn....hhhh>>>>
  14.  
  15.      ssss ==== ssssoooocccckkkkeeeetttt((((AAAAFFFF____IIIINNNNEEEETTTT,,,, SSSSOOOOCCCCKKKK____RRRRAAAAWWWW,,,, pppprrrroooottttoooo))));;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      IP is the network layer protocol used by the Internet protocol family.
  19.      Options may be set at the IP level when using higher-level protocols that
  20.      are based on IP (such as TCP and UDP).  It may also be accessed through a
  21.      "raw socket" when developing new protocols, or special purpose
  22.      applications.
  23.  
  24.      There are several IP-level _s_e_t_s_o_c_k_o_p_t(2)/_g_e_t_s_o_c_k_o_p_t(2) options.
  25.      IP_OPTIONS may be used to provide IP header options to be transmitted in
  26.      each outgoing packet or to examine the header options on incoming
  27.      packets.  IP_OPTIONS may be used with any socket type in the Internet
  28.      family.  The format of IP options to be sent is that specified by the IP
  29.      protocol specification (RFC-791), with one exception:  the list of
  30.      addresses for Source Route options must include the first-hop gateway at
  31.      the beginning of the list of gateways.  The first-hop gateway address
  32.      will be extracted from the option list and the size adjusted accordingly
  33.      before use.  To disable previously specified options, use a zero-length
  34.      buffer:
  35.  
  36.           setsockopt(s, IPPROTO_IP, IP_OPTIONS, NULL, 0);
  37.  
  38.      IP_TOS and IP_TTL may be used to set the type-of-service and time-to-live
  39.      fields in the IP header for SOCK_STREAM and SOCK_DGRAM sockets. For
  40.      example,
  41.  
  42.           int tos = IPTOS_LOWDELAY;     /* see <netinet/ip.h> */
  43.           int ttl = 60;            /* max = 255 */
  44.           setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
  45.           setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
  46.  
  47.      IP_HDRINCL indicates the complete IP header is included with the data and
  48.      may be used only with the SOCK_RAW type.
  49.  
  50.           int hincl = 1;           /* 1 = on, 0 = off */
  51.           setsockopt(s, IPPROTO_IP, IP_HDRINCL, &hincl, sizeof(hincl));
  52.  
  53.  
  54.    RRRRaaaawwww IIIIPPPP SSSSoooocccckkkkeeeettttssss
  55.      Raw IP sockets are connectionless, and are normally used with the _s_e_n_d_t_o
  56.      and _r_e_c_v_f_r_o_m calls, though the _c_o_n_n_e_c_t(2) call may also be used to fix
  57.      the destination for future packets (in which case the _r_e_a_d(2) or _r_e_c_v(2)
  58.      and _w_r_i_t_e(2) or _s_e_n_d(2) system calls may be used).  Only the super-user
  59.      can create raw IP sockets.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. IIIIPPPP((((7777PPPP))))                                                                  IIIIPPPP((((7777PPPP))))
  71.  
  72.  
  73.  
  74.      If _p_r_o_t_o is 0, the default protocol IPPROTO_RAW is used for outgoing
  75.      packets, and only incoming packets destined for that protocol are
  76.      received.  If _p_r_o_t_o is non-zero, that protocol number will be used on
  77.      outgoing packets and to filter incoming packets.
  78.  
  79.      Outgoing packets automatically have an IP header prepended to them (based
  80.      on the destination address and the protocol number the socket is created
  81.      with), unless the IP_HDRINCL option has been set.  Incoming packets are
  82.      received with IP header and options intact.
  83.  
  84. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  85.      A socket operation may fail with one of the following errors returned:
  86.  
  87.      [EACESS]       Permission to create a raw IP socket is denied.
  88.  
  89.      [EISCONN]      when trying to establish a connection on a socket which
  90.                     already has one, or when trying to send a datagram with
  91.                     the destination address specified and the socket is
  92.                     already connected;
  93.  
  94.      [ENOTCONN]     when trying to send a datagram, but no destination address
  95.                     is specified, and the socket hasn't been connected;
  96.  
  97.      [ENOBUFS]      when the system runs out of memory for an internal data
  98.                     structure;
  99.  
  100.      [EADDRNOTAVAIL]
  101.                     when an attempt is made to create a socket with a network
  102.                     address for which no network interface exists.
  103.  
  104.      The following errors specific to IP may occur when setting or getting IP
  105.      options:
  106.  
  107.      [EINVAL]       An unknown socket option name was given.
  108.  
  109.      [EINVAL]       The IP option field was improperly formed; an option field
  110.                     was shorter than the minimum value or longer than the
  111.                     option buffer provided.
  112.  
  113. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  114.      getsockopt(2), send(2), recv(2), intro(3), icmp(7P), inet(7F), route(7F),
  115.      _I_R_I_X _N_e_t_w_o_r_k _P_r_o_g_r_a_m_m_i_n_g _G_u_i_d_e
  116.      RFC-791
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.